package com.yiqi.liebang.feature.home.model;

import com.baiiu.filter.ClassifyBo;
import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.liebang.entity.bo.BanlanceBo;
import com.yiqi.liebang.entity.bo.CreateOrderBo;
import com.yiqi.liebang.entity.bo.ExpertBo;
import com.yiqi.liebang.entity.bo.PageBo;
import com.yiqi.liebang.entity.bo.PayBo;
import com.yiqi.liebang.entity.bo.PeopleBo;
import com.yiqi.liebang.feature.home.contract.ClassifyContract;
import com.yiqi.liebang.feature.home.contract.PayContract;
import com.yiqi.liebang.feature.home.dependencies.classsify.DaggerClassifyModelComponent;
import com.yiqi.liebang.feature.home.dependencies.pay.DaggerPayModelComponent;
import com.yiqi.liebang.framework.api.ApiLib;
import com.yiqi.liebang.framework.api.HomeApi;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;

public class PayModel implements PayContract.Model {

    @Inject
    HomeApi api;


    @Inject
    public PayModel() {

        DaggerPayModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }




    @Override
    public Observable<PayBo> createOrder(CreateOrderBo createOrderBo) {
        return api.toOrder(createOrderBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<BanlanceBo> getUserAssetsDetail(PageBo rechargeBo) {
        return api.getUserAssetsDetail(rechargeBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
